#define  _CRT_SECURE_NO_WARNINGS 1
#include"SList.h"
void test1() {
	SLTNode*n1= BuySLnode(1);
	SLTNode*n2=BuySLnode(2);
	SLTNode* n3 = BuySLnode(3);
	SLTNode* n4 = BuySLnode(4);
	n1->next = n2;
	n2->next = n3;
	n3->next = n4;
	n4->next = NULL;
}

void test2() {
	SLTNode* plist = CreateSList(5);
	SLTPrint(plist);
}

void test3() {
	SLTNode* plist = CreateSList(5);
	SLTPushBack(&plist, 100);
	SLTPushBack(&plist, 200);
	SLTPushBack(&plist, 300);
	SLTPopBack(&plist);
	SLTPopBack(&plist);
	SLTPrint(plist);
}
void test4() {
	SLTNode* plist = CreateSList(5);
	SLTPushFront(&plist,100);
	SLTPushFront(&plist, 200);
	SLTPushFront(&plist, 300);
	SLTPopFront(&plist);
	SLTPopFront(&plist);
	SLTPrint(plist);
}

void test5() {
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPushBack(&plist, 5);


	SLTNode* p = SLTFind(plist, 3);
	//SLTInsertAfter(p, 30);
	SLTInsert(&plist,p,30);
	SLTPrint(plist);

}
void test6() {
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPushBack(&plist, 5);


	SLTNode* p = SLTFind(plist, 3);
	//SLTEraseAfter(p);
	SLTErase(&plist,p);
	SLTPrint(plist);

}
void test7() {
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPushBack(&plist, 5);
	SLTPrint(plist);

	SLTNode* p = SLTFind(plist, 3);
	SLTEraseAfter(p);
	SLTPrint(plist);
	SLTDestroy(&plist);

	SLTPrint(plist);
}

int main() {
	//test1();
	//test2();
	//test3();
	//test4();
	//test5();
	//test6();
	test7();
	return 0;
}